<%@ page language="java" pageEncoding="UTF-8"%>
<div ng-controller="UserBarEditController">
	<form callback="save" validate>
		<div class="form-group">
			<label>
				名称 <i class="glyphicon glyphicon-exclamation-sign" message="'{username}代表用户名占位符'" tooltip></i>
			</label><br/>
			<input class="form-control" type="text" name="name" ng-model="bar.text" rule="required;" />
		</div>
		<div class="form-group">
			<label>
				图标
			</label><br/>
			<input class="form-control" type="text" name="icon" ng-model="bar.icon"/>
		</div>
		<div class="form-group">
			<label>
				父节点 <i class="glyphicon glyphicon-exclamation-sign" message="'0代表根节点'" tooltip></i>
			</label><br/>
			<select class="form-control" ng-model="bar.parent">
				<option ng-repeat="root in roots" value="{{root.id}}" ng-selected="{{bar.parent==root.id}}">
					{{root.text}}
				</option>
			</select>
		</div>
		<div class="form-group">
			<label>
				索引 <i class="glyphicon glyphicon-exclamation-sign" message="'数字越大越靠后'" tooltip></i>
			</label><br/>
			<input class="form-control" type="text" name="index" ng-model="bar.index" rule="required;integer[+0];"/>
		</div>
		<div class="form-group">
			<label>
				链接
			</label><br/>
			<input class="form-control" type="text" name="url" ng-model="bar.url"/>
		</div>
		<div class="form-group">
			<label>
				单击事件
			</label><br/>
			<input class="form-control" type="text" name="click" ng-model="bar.click"/>
		</div>
		<div>
			<button type="submit" class="btn btn-success btn-sm"><i class="glyphicon glyphicon-ok"/> 保存</button>
			<button type="button" class="btn btn-danger btn-sm" ng-click="cancel()"><i class="glyphicon glyphicon-remove"/> 取消</button>
		</div>
	</form>
</div>